
namespace FastFood.Business.Logic
{
	using System;
	using System.Collections.Generic;
	using EDOSwit.Entity;
	using FastFood.Business.Entities;
	using FastFood.DataAccess;
    using System.Linq;

	/// <summary>
	/// Represents the Manager of Clientes.
	/// </summary>
	[Serializable]
	public class ClientesManager : Singleton<ClientesManager>
	{
        #region Methods

        public IList<Clientes> ListarByNombres(string nombres)
        {
            try
			{
                return ClientesData.Instancia.ListarByNombre(nombres).Reverse().ToList();
			}
			catch (Exception) { throw; }
        }

        public IList<Clientes> ListarByApellidos(string apellidos)
        {
            try
            {
                return ClientesData.Instancia.ListarByApellidos(apellidos).Reverse().ToList();
            }
            catch (Exception) { throw; }
        }

        public IList<Clientes> ListarByDNI(string DNI)
        {
            try
            {
                return ClientesData.Instancia.ListarByDNI(DNI).Reverse().ToList();
            }
            catch (Exception) { throw; }
        }

        public IList<Clientes> ListarByRUC(string RUC)
        {
            try
            {
                return ClientesData.Instancia.ListarByRUC(RUC).Reverse().ToList();
            }
            catch (Exception) { throw; }
        }

		/// <summary>
		/// Selects all records from the Clientes table.
		/// </summary>
		public IList<Clientes> Listar()
		{
			try
			{
                return ClientesData.Instancia.Listar().Reverse().ToList();
			}
			catch (Exception) { throw; }
		}

		/// <summary>
		/// Selects a single record from the Clientes table.
		/// </summary>
		public Clientes Obtener(int clienteID)
		{
			try
			{
				return ClientesData.Instancia.Obtener(clienteID);
			}
			catch (Exception) { throw; }
		}

		/// <summary>
		/// Saves a record to the Clientes table.
		/// </summary>
		public int Agregar(Clientes clientes)
		{
			try
			{
				return ClientesData.Instancia.Agregar(clientes);
			}
			catch (Exception) { throw; }
		}

		/// <summary>
		/// Updates a record in the Clientes table.
		/// </summary>
		public bool Modificar(Clientes clientes)
		{
			try
			{
				return ClientesData.Instancia.Modificar(clientes);
			}
			catch (Exception) { throw; }
		}

		/// <summary>
		/// Deletes a record from the Clientes table by its primary key.
		/// </summary>
		public bool Eliminar(int clienteID)
		{
			try
			{
				return ClientesData.Instancia.Eliminar(clienteID);
			}
			catch (Exception) { throw; }
		}

		#endregion
	}
}
